#include <iostream>
#include <string>
using namespace std;

int Alice[10000];
int Bob[10000];
int countA=0;
int countB=0;

void findAB(string str){
	for(int a=0;a<str.size();a++){
		if((str[a]=='A')&&(str[a+1]=='l')&&(str[a+2]=='i')&&(str[a+3]=='c')&&(str[a+4]=='e')){
			char x=str[a+5];
			if(!((x<='z')&&(x>='a'))){
				Alice[countA]=a;
				countA++;
				a+=4;	
			}
		}
		if((str[a]=='B')&&(str[a+1]=='o')&&(str[a+2]=='b')){
			char y=str[a+3];
			if(!((y<='z')&&(y>='a'))){
				Bob[countB]=a;
				countB++;
				a+=2;	
			}
		}
	}
}

int cal(){
	int ia=0;
	int ib=0;
	int sum=0;
	
	while((ia<=countA)&&(ib<=countB)){
		int tmp=Alice[ia]-Bob[ib];
		if(tmp>23){
			ib++;
		}
		else if((tmp<=23)&&(tmp>=-25)){
			sum++;
			ib++;
		}
		else if(tmp<-25){
			ia++;
		}
	}
	return sum;
}

int main(){
	string word;
	getline(cin,word,'\n');
	findAB(word);
	
	for(int i=0;i<countA;i++){
		cout<<Alice[i]<<" ";
	}
	cout<<endl;
	for(int i=0;i<countB;i++){
		cout<<Bob[i]<<" ";
	}
	
	cout<<endl;
	cout<<cal();
	return 0;
}// Alice Alica Bob Alice Bo b!! @ # Bo Alice
// Alice Alica Bobb Alice Bo b!! @ # Bo Alice
